package com.yc.forum.servlet;

import com.yc.forum.dao.PostDao;
import com.yc.forum.util.Utils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
//获取贴子总数
@WebServlet(name="GetPostSumServlet",value="/GetPostSumServlet.s")
public class GetPostSumServlet extends HttpServlet {
    PostDao postDao=new PostDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String problemId=req.getParameter("problemId");
        int sum=postDao.selectPostSum(problemId);
        Utils.toJson(sum,resp);
    }
}
